<!--
 * @Author: yankee liuchuan@yanxinfo.com
 * @Date: 2023-11-18 11:59:33
 * @LastEditors: yankee liuchuan@yanxinfo.com
 * @LastEditTime: 2023-11-25 13:32:52
 * @FilePath: /AB/src/components/SvgIcon/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <svg :class="svgClass" aria-hidden="true">
    <use :xlink:href="iconName" rel="external nofollow" />
  </svg>
</template>

<script lang="ts" setup>
import { computed } from "vue";
const props = defineProps({
  color: { type: String, default: "red" },
  name: { type: String, default: "" },
  className: { type: String, default: "" },
});
const iconName = computed(() => {
  return props.name ? `#icon-${props.name}` : "#icon";
});
const svgClass = computed(() => {
  return props.className ? "svg-icon " + props.className : "svg-icon";
});
</script>

<style scoped lang="less">
.svg-icon {
  width: 0.8em;
  height: 0.8em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
